// const tools = {
// 	/**
// 	 * 显示loading框
// 	 * @return {[type]}
// 	 */
// 	showLoading() {
// 		if (this.loadingCount <= 0) {
// 			ReactDOM.render(
// 				<div className="sy-loadingwrap">
// 					<Spin size="large"></Spin>
// 				</div>,
// 				document.getElementById("sy-loading")
// 			);
// 		}
// 		this.loadingCount++;
// 	},
// 	/**
// 	 * 隐藏loading框
// 	 * @return {[type]}
// 	 */
// 	hideLoading() {
// 		if (this.loadingCount === 0) return;
// 		this.loadingCount--;
// 		if (this.loadingCount === 0) {
// 			ReactDOM.unmountComponentAtNode(document.getElementById("sy-loading"));
// 		}
// 	}
// };

// export const tableColumnsRender = (text, row, index) => {
// 	if (index < 4) {
// 		return <a>{text}</a>;
// 	}
// 	return {
// 		children: <a>{text}</a>,
// 		props: {
// 			colSpan: 5
// 		}
// 	};
// };

// export function formatSex(sex: number) {

// }

export const formatSex = (sex: number) => (sex == 1 ? "男" : "女");
export const formatInterest = (interest: number) => {
	let lists: Array<string> = ["其他", "游泳", "读书", "唱歌", "跳舞"];
	return lists[interest];
};
export const formatCarMode = (mode: number) => {
	switch (mode) {
		case 1:
			return "指定停车点模式";
		case 2:
			return "禁停区";
		default:
			return "未选择";
	}
};
export const formatOperationMode = (mode: number) => {
	switch (mode) {
		case 1:
			return "自营";
		case 2:
			return "加盟";
		default:
			return "未选择";
	}
};
// export const formatFranchisee = (mode: number) => {
// 	switch (mode) {
// 		case 1:
// 			return "已授权";
// 		case 2:
// 			return "未授权";
// 		default:
// 			return "未选择";
// 	}
// };
export const formatAuthStatus = (mode: number) => {
	switch (mode) {
		case 1:
			return "已授权";
		case 2:
			return "未授权";
		default:
			return "未选择";
	}
};
export const formatCityAdmins = (admins: Array<{ userName: string; userId: number }>) => {
	return admins
		.map(admin => {
			return admin.userName;
		})
		.join(` , `);
};
